package com.winit.sellerportal.repository;

import com.winit.sellerportal.model.WinitMenu;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WinitMenuRepository extends CrudRepository<WinitMenu, Integer> {

//    List<WinitMenu> findAll();

    @Query(value = "SELECT * from winit_menu where parent_id = ?1 and is_active='Y' and is_deleted = 'N' order by menu_sort desc", nativeQuery = true)
    List<WinitMenu> findAllParent(Integer parent);

}
